#ifndef f_lib_network_h_
#define f_lib_network_h_

// socket declaration

#ifndef WIN32
typedef int STREAMBOX_SOCKET;
#elif defined WIN32
typedef SOCKET STREAMBOX_SOCKET;
#else
#error Define SOCKET on your Platform
#endif


int IP_InitSocket(STREAMBOX_SOCKET* pSock/*, const char* szLocalIP*/, int nTCPPort = 777);
int IP_CloseSocket(STREAMBOX_SOCKET* pSock);
int IP_RecievePacket(STREAMBOX_SOCKET *pSock, void *buf, int nBufSize);

// Set the listen file descriptor to no-delay mode. 
int IP_SetNonDelayMode(STREAMBOX_SOCKET *pSock);

#endif